repo.or.cz
/
andmenj-acm.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Solving 10385 - Duathlon (Ternary search)
[andmenj-acm.git]
/
10195 - Knights of the round table
/
10195.cpp
blob
412d7fdf6325a733d3ae24706d2a34dbade47246
1
#include <iostream>
2
#include <math.h>
3
#include <cassert>
4
5
using namespace
std
;
6
7
main
(){
8
double
a
,
b
,
c
,
s
,
r
,
temp
;
9
while
(
cin
>>
a
>>
b
>>
c
){
10
s
= (
a
+
b
+
c
)/
2
;
11
temp
=
s
*(
s
-
a
)*(
s
-
b
)*(
s
-
c
);
12
assert
(
temp
>=
0
);
13
//cout << "s es : " << s << endl;
14
if
(
s
==
0.0
)
15
r
=
0.0
;
16
else
17
r
=
sqrt
(
temp
)/
s
;
18
printf
(
"The radius of the round table is: %0.3f
\n
"
,
floor
(
r
*
1000
+
0.5
)/
1000
);
19
}
20
return
0
;
21
}